package com.manage.web.bl;
/**
 * 测试代码生成数据库表和修改数据库表名
 * @author duaiyu
 * @version V1.0
 * @date 2022/2/20
 * 来源：自研
 */
public class TestCreateTable {
    //创建数据库表
    public static String createTableSQL(){
        String sql = "CREATE TABLE `testTable21`  (\n" +
                "\t\t`id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',\n" +
                "\t\t`date` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日期',\n" +
                "\t\t`type` varchar(90) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型，1假期,2周末,3工作日',\n" +
                "\t\tPRIMARY KEY (`id`) USING BTREE\n" +
                ") ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic";
        return sql;
    }
    //修改表名
    public static String alterTableName(String oldTableName, String newTableName){
        String sql = "alter table " + oldTableName + " rename to " + newTableName;
        return sql;
    }
}
